<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<script>
  var  arr=['a','b','c','d','f','d'];
  var a= arr.slice(2);
  var b= arr.slice(2,8);
  for (var i=0;i<a.length; i++){
      alert(a[i]);
  }
  for (var i=0;i<b.length; i++){
    alert(b[i]);
  }
</script>

</body>
</html>
